package com.example.demo.design.mode.singleton;

/**
 * @Classname DCLSingletonAndVolatitle
 * @Description
 * @Date 2023/12/12 16:08
 * @Created by jyl
 */
public class DCLSingletonAndVolatitle {
    private static volatile DCLSingletonAndVolatitle INSTANCE;

    private DCLSingletonAndVolatitle() {}

    public static DCLSingletonAndVolatitle getInstance() {
        if (INSTANCE == null) {
            synchronized (DCLSingletonAndVolatitle.class) {
                if (INSTANCE == null) {
                    INSTANCE = new DCLSingletonAndVolatitle();
                }
            }
        }
        return INSTANCE;
    }
}
